package com.example.demo.config;

import java.util.concurrent.Executors;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

@Configuration
public class ScheduleConfig implements SchedulingConfigurer{
	
	private static final Logger logger = LogManager.getLogger(ScheduleConfig.class);

	@Override
	public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
		logger.info("ScheduleConfig-> configureTasks");
        taskRegistrar.setScheduler(Executors.newScheduledThreadPool(2));
	}

}
